﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObTookit.Auto
{
    public class DACoder:BaseCoder
    {
        public string CreateCode()
        {
            FieldObject pkFO = GetIdObject();
            string text = ReadTemplate(Template);
            text = text.Replace("[#ModelNS#]", AutoObj.OmNS);
            text = text.Replace("[#AUTHOR#]", Author);
            text = text.Replace("[#CREATED#]", CreateDate);
            text = text.Replace("[#DalNS#]", AutoObj.DaNS);
            text = text.Replace("[#ClsName#]", AutoObj.ClsName);

            text = text.Replace("[#IdAlias#]", pkFO.Alias);
            text = text.Replace("[#IdName#]", AutoObj.IdName);
            text = text.Replace("[#IdSysType#]", GetIdType(pkFO.Type));
            return text;
        }
    }
}
